﻿/**********************************************************************
 * @file   FITKRadiossAdaptorPropShell.h
 * @brief  板壳属性读取适配器
 * @author zhangjingx (hiter25@outlook.com)
 * @date   2025-07-11
 *********************************************************************/
#ifndef __FITKRADIOSSADAPTORPROPSHELL_H__
#define __FITKRADIOSSADAPTORPROPSHELL_H__
#include "FITKRadiossRadIOAPI.h"
#include "FITKRadiossAbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

namespace Radioss
{
    class FITKPropShell;
    /**
     * @brief  板壳属性读取适配器
     * @author zhangjingx (hiter25@outlook.com)
     * @date   2025-07-11
     */
    class FITKRadiossRadIOAPI FITKRadiossAdaptorPropShell : public FITKRadiossAbstractAdaptor
    {
    public:
        explicit FITKRadiossAdaptorPropShell() = default;
        ~FITKRadiossAdaptorPropShell() = default;
        /**
         * @brief
         * @return   QString
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-08
         */
        QString getAdaptorClass() override;
        /**
         * @brief    适配器读取
         * @return   bool
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-08
         */
        bool adaptR() override;
        /**
         * @brief    适配器写出
         * @return   bool
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-08
         */
        bool adaptW() override;
    private:
        /**
         * @brief    读取属性信息
         * @param[i] solid 
         * @return   bool
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-11
         */
        bool readPropShell(FITKPropShell* shell);
        /**
         * @brief    读取参数
         * @param[i] solidText 
         * @return   void
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-15
         */
        void readParam(const QStringList& lines);
        /**
         * @brief    固体属性对象赋值
         * @param[i] solid 
         * @return   void
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-15
         */
        void setPropData(FITKPropShell* solid);
    private:
        /**
         * @brief  固体属性参数
         * @author zhangjingx (hiter25@outlook.com)
         * @date   2025-07-15
         */
        QHash<int, double> _shellPar{};
    };
    /**
     * @brief  注册适配器
     * @author zhangjingx (hiter25@outlook.com)
     * @date   2025-07-09
     */
    Register2FITKIOAdaptorFactory(rad, Radioss::FITKPropShell, FITKRadiossAdaptorPropShell);
    RegRadiossRadAdaptor(/PROP/TYPE1, FITKRadiossAdaptorPropShell);
    RegRadiossRadAdaptor(/PROP/SHELL, FITKRadiossAdaptorPropShell, 0);

}
#endif //!__FITKRADIOSSADAPTORPROPSHELL_H__
